package com.ruimei.controller;

import com.ruimei.entitys.RollBook;
import com.ruimei.entitys.Student;
import com.ruimei.service.RollBookService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Map;

@Controller
@Api(tags={"点名系统"})
public class RollBookController {

    @Resource
    RollBookService service;


    @ApiOperation("创建点名名单")
    @PostMapping({"/roll/add"})
    @ResponseBody
    public Map<String, Object> addRollBook(RollBook rollBook){
        Map<String, Object> map = service.addRollBook(rollBook);
        return map;
    }

    @ApiOperation("获取点名名单")
    @PostMapping({"/roll/get"})
    @ResponseBody
    public Map<String, Object> getRoll(RollBook rollBook){
        Map<String, Object> map = service.getRoll(rollBook);
        return map;
    }

    @ApiOperation("修改点名名单")
    @PostMapping({"/roll/set"})
    @ResponseBody
    public Map<String, Object> setRoll(RollBook rollBook){
        Map<String, Object> map = service.setRoll(rollBook);
        return map;
    }

    @ApiOperation("获取学生及家长信息")
    @PostMapping({"/roll/parent"})
    @ResponseBody
    public Map<String, Object> getStuParent(String classId,String studentName){
        Map<String, Object> map = service.getStuParent(classId,studentName);
        return map;
    }

}
